package com.ellecity06.common.listener

import android.os.SystemClock
import android.view.View

abstract class DebounceListener : View.OnClickListener {
    private var lastClickTime: Long = 0
    private val interval = 500
    override fun onClick(v: View) {
        val currentTime = SystemClock.elapsedRealtime()
        if (currentTime - lastClickTime > interval) {
            onClick()
            lastClickTime = currentTime
        }
    }

    protected abstract fun onClick()
}